package cn.edu.scau.cmi.chenyuesong.adapter;

import java.util.ArrayList;
import java.util.List;

public class ClassAdapter extends SortUtil implements StudentSort{
	public void SortStuList(List<Student> students) {
		List<Integer> intlist = new ArrayList<Integer>();
		for(int i = 0;i < students.size(); i++) {
            intlist.add(students.get(i).num);
		}
		sortInt(intlist);
		for(int i=0;i<students.size(); i++) {
            for(int j=0;j<students.size();j++) {
            	if(students.get(j).num == intlist.get(i)) {
            		Student bigger = students.get(i);
            		students.set(i,students.get(j));
            		students.set(j,bigger);
            		break;
            	}
            }
		}
	}
}
